<template>
	<view>
		<view class="page-body">
			<view class="page-section page-section-gap" style="height: 100vh;">
				<map style="width: 100%; height: 100%;" 
					:scale="12"
					:show-location="true"
					:latitude="latitude" 
					:longitude="longitude" 
					:markers="covers">
				</map>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: 0, // 使用 marker点击事件 需要填写id
				title: 'map',
				latitude: 39.909,
				longitude: 116.39742,
				covers: []
			}
		},
		onLoad(e){
			this.latitude = parseFloat(e.lgt);
			this.longitude = parseFloat(e.lan);
			this.covers.push({
				latitude: parseFloat(e.lgt),
				longitude: parseFloat(e.lan),
				title:"当前酒店位置",
				iconPath: '/pagessub/static/location.png'
			})
		},
		methods: {
			addCovers(){
				this.covers = [{
					latitude: 39.909,
					longitude: 116.39742,
					title:"当前位置",
					iconPath: '/pagessub/static/location.png'
				}, {
					latitude: 39.90,
					longitude: 116.39,
					title:"周边位置1111",
					iconPath: '/pagessub/static/location.png'
				}];
			}
		}
	}
</script>

<style>

</style>
